package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.CostDto;
import xyz.zhouzhaodong.crm.service.ICostService;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 费用表 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-06-18
 */
@RestController
@RequestMapping("/cost")
public class CostController {

    @Resource
    ICostService costService;

    /**
     * 新增
     * @param costDto
     * @return
     */
    @RequestMapping("/add")
    public RestMessage addCost(CostDto costDto){
        return costService.addCost(costDto);
    }

    /**
     * 删除
     * @param costDto
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteCost(CostDto costDto){
        return costService.deleteCost(costDto);
    }

    /**
     * 修改
     * @param costDto
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateCost(CostDto costDto){
        return costService.updateCost(costDto);
    }

    /**
     * 查询
     * @param costDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectCost(CostDto costDto){
        return costService.selectCost(costDto);
    }

    /**
     * 根据用户id查询列表
     * @param costDto
     * @return
     */
    @RequestMapping("/selectList")
    public RestMessage selectCostList(CostDto costDto){
        return costService.selectCostList(costDto);
    }

}
